<template>
  <div class="header">
    <!-- 头部返回和背景图 -->
    <div class="header_bgimg"  :style="{backgroundImage: 'url(' + coverImgUrl + ')'}">
      <div class="shadow">
        <mt-button icon="back" size="large" @click.native="back"></mt-button>
      </div>
    </div>
    <!-- logo 居中 绝对定位 -->
    <div class="header_logo">
      <img :src="'http://elm.cangdu.org/img/'+shopName.image_path">
    </div>
    <!-- 商家活动 -->
    <div class="shopAct">
      <div class="shop_Name">
        <span>{{shopName.name}}</span>
        <img src="./images/showRight.png" alt="">
      </div>
      <div class="shop_Sales">
        <span>评价{{shopName.rating}}</span>
        <span>月销{{shopName.recent_order_num}}单</span>
        <span>蜂鸟快送约26分钟</span>
      </div>
      <div class="shop_ConAct">
        <div class="momenyJ">
          <div>
            <span>
              <small>￥8</small>
            </span>
            <span>无门槛</span>
          </div>
          <div>领取</div>
        </div>
        <div class="hiddenJ">
          <i>满减</i>
          <p>满30减16,满65减26，满98减38，满150减50</p>
          <span>5个优惠</span>
          <img src="./images/showB.png" alt="">
        </div>
        <div class="shop_tips">
          <p>
           {{shopName.promotion_info}}
          </p>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import {reqshopName} from '../../api/index.js'
export default {
  data() {
    return {
      shopName:{} //店铺名字
    }
  },
  computed: {
    coverImgUrl(){
      return 'http://elm.cangdu.org/img/'+this.shopName.image_path
    }
  },
  async mounted() {
    this.shopName=await reqshopName(this.$route.params.id)
  },
  methods: {
    back(){
      this.$router.back(-1);
    }
  },
};
</script>
<style lang="scss" scoped>
.header {
  .header_bgimg {
    height: 1.75rem;
    // background-image: url("./images/logo.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    .shadow {
      width: 100%;
      height: 100%;
      background-image: linear-gradient(
        0deg,
        hsla(0, 0%, 100%, 0),
        rgba(0, 0, 0, 0.5)
      );
    }

    .mint-button {
      background-color: rgba(0, 0, 0, 0);
      color: white;
    }
    .mint-button--large {
      width: auto;
    }
  }
  .header_logo {
    display: flex;
    justify-content: center;
    img {
      width: 20%;
      height: 100%;
      margin-top: -1.1rem;
    }
  }
  .shopAct {
    display: flex;
    justify-content: center;
    flex-flow: wrap;
    margin-top: 0.2rem;
    .shop_Name {
      font-size: 22px;
      font-weight: 600;
      display: flex;
      justify-content: center;
      width: 65%;
    }
    .shop_Sales {
      font-size: 12px;
      color: #666;
      margin-top: 0.1rem;
      display: flex;
      justify-content: space-around;
      width: 60%;
    }
    .shop_ConAct {
      width: 80%;
      .momenyJ {
        font-size: 15px;
        display: flex;
        justify-content: center;
        margin-top: 0.1rem;
        div {
          border-radius: 5px;
          background: #ffe578;
          padding: 5px 15px;
          font-size: 12px;
          color: #594519;
          small {
            font-weight: 600;
          }
        }
      }
      .hiddenJ {
        font-size: 12px;
        display: flex;
        flex-flow: nowrap;
        text-align: center;
        margin-top:.18rem;
        i {
          width: 12%;
          background-color: rgb(240, 115, 115);
          color: white;
        }
        p {
          width: 68%;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
          color: #333333;
        }
        span {
          width: 20%;
          color: #999;
        }
      }
      .shop_tips {
        font-size: 12px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        color: #999;
        margin-top:.18rem;
      }
    }
  }
}
</style>
